﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
namespace Corona.TagToolkit
{
    
    public class Verify
    {
        string appName;

        public string AppName
        {
            get { return appName; }
            set { appName = value; }
        }
        XmlDocument appDescription;

        public XmlDocument AppDescription
        {
            get { return appDescription; }
            set { appDescription = value; }
        }

        public override string ToString()
        {
            return appName + ":" + GetXmlDocumentMd5(appDescription);
            
        }
        public static string GetXmlDocumentMd5(XmlDocument dom)
        {
            System.Security.Cryptography.MD5CryptoServiceProvider getMd5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
            return BitConverter.ToString(getMd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(dom.InnerXml))).Replace("-", "");
            
        }
    }
}
